Dynomotion

Group: DynoMotion Message: 13804 From: cnc_machines Date: 10/10/2016
Subject: Axis Homing - Using Following Error

Greetings,


I have a K-Step with closed loop feedback. I am trying to write a program that will home an axis by running it into a hard stop, and using encoder error to tell me I have hit the stop and then zero the axis. 


I am struggling to find the function that tells me what the current error is on a particular axis. Here is what I am trying:



ch0->MaxFollowingError=500; //Set a high following error value

Jog(0,1000); //Slowly jog axis towards limit

while(FollowingError < 10); //Jog until following error

Jog(0,0); // stop

while (!CheckDone(0)) ; // loop until motion completes 

DisableAxis(0); // disable the axis

Zero(0); // Zero the position

EnableAxis(0); // re-enable the ServoTick

ch0->MaxFollowingError=50; // Set normal error limit


Is there a function like "FollowingError(CH(0))" in "KMotionDef.h"? I would really appreciate any help on this, probably a simple thing I am missing.


Thanks,


Scott



Group: DynoMotion Message: 13806 From: Moray Cuthill Date: 10/10/2016
Subject: Re: Axis Homing - Using Following Error
Scott,

To get the following error, read the actual (chX->Position) and commanded (chZ->Dest) channel positions, and do a bit subtraction.
I do notice there is a DestOffset value, but I'm not sure what it does?

However, when following error is exceeded, the axis is automatically disabled.

Moray

On Mon, Oct 10, 2016 at 9:17 PM, cnc_machines@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Greetings,


I have a K-Step with closed loop feedback. I am trying to write a program that will home an axis by running it into a hard stop, and using encoder error to tell me I have hit the stop and then zero the axis. 


I am struggling to find the function that tells me what the current error is on a particular axis. Here is what I am trying:



ch0->MaxFollowingError=500; //Set a high following error value

Jog(0,1000); //Slowly jog axis towards limit

while(FollowingError < 10); //Jog until following error

Jog(0,0); // stop

while (!CheckDone(0)) ; // loop until motion completes 

DisableAxis(0); // disable the axis

Zero(0); // Zero the position

EnableAxis(0); // re-enable the ServoTick

ch0->MaxFollowingError=50; // Set normal error limit


Is there a function like "FollowingError(CH(0))" in "KMotionDef.h"? I would really appreciate any help on this, probably a simple thing I am missing.


Thanks,


Scott




Group: DynoMotion Message: 13809 From: Tom Kerekes Date: 10/10/2016
Subject: Re: Axis Homing - Using Following Error

As Moray said subtracting should work.  But there is also is a Axis variable ch->LastFollowingError that should also work.

Regards

TK


On 10/10/2016 3:52 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
Scott,

To get the following error, read the actual (chX->Position) and commanded (chZ->Dest) channel positions, and do a bit subtraction.
I do notice there is a DestOffset value, but I'm not sure what it does?

However, when following error is exceeded, the axis is automatically disabled.

Moray

On Mon, Oct 10, 2016 at 9:17 PM, cnc_machines@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Greetings,


I have a K-Step with closed loop feedback. I am trying to write a program that will home an axis by running it into a hard stop, and using encoder error to tell me I have hit the stop and then zero the axis. 


I am struggling to find the function that tells me what the current error is on a particular axis. Here is what I am trying:



ch0->MaxFollowingError=500; //Set a high following error value

Jog(0,1000); //Slowly jog axis towards limit

while(FollowingError < 10); //Jog until following error

Jog(0,0); // stop

while (!CheckDone(0)) ; // loop until motion completes 

DisableAxis(0); // disable the axis

Zero(0); // Zero the position

EnableAxis(0); // re-enable the ServoTick

ch0->MaxFollowingError=50; // Set normal error limit


Is there a function like "FollowingError(CH(0))" in "KMotionDef.h"? I would really appreciate any help on this, probably a simple thing I am missing.


Thanks,


Scott